package top.yehot.cmmu.mybatis.model;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.ToString;

/**
 * 分页信息类
 * 
 * @author lquan
 * @date 2022-9-10 11:44:25
 */
@Getter
@ToString
@ApiModel("分页对象")
public class PageQuery implements Serializable {
 
	private static final long serialVersionUID = -3596032285244775337L;
	
	private static final Integer DEFAULT_PGCT = 1;
	private static final Integer DEFAULT_PGSZ = 10;
	
	@ApiModelProperty("当前页码")
	private Integer pgCt = DEFAULT_PGCT;
	
	@ApiModelProperty("每页记录条数")
    private Integer pgSz = DEFAULT_PGSZ;
    
    public void setPgCt(Integer pgCt) {
        this.pgCt = pgCt == null || pgCt <= 0 ? DEFAULT_PGCT : pgCt;
    }

    public void setPgSz(Integer pgSz) {
        this.pgSz = pgSz == null || pgSz <= 0 ? DEFAULT_PGSZ : pgSz;
    }

//    public Integer getStart() {
//        return (this.pgCt - 1) * this.pgSz;
//    }

}
